// process.argv
process.argv.forEach(function(item, index) {
  // print
  console.log(index + ' : ' + typeof(item) + ' : ', item);
  
  // if argument is --exit
  if (item == '--exit') {
    // get next argument
    var exitTime = Number(process.argv[index + 1]);
    
    // exit program after specific time
    setTimeout(function() {
      process.exit();
    }, exitTime);
  }
});